import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * member模块-用户信息
 */
@Entity('member_user_info')
export class MemberUserInfoEntity extends BaseEntity {
  @Index()
  @Column({ comment: '用户名', length: 50 })
  username: string;

  @Column({ comment: '密码', length: 100 })
  password: string;

  @Column({ comment: '图像', length: 200 })
  avatar: string;

  @Column({ comment: '昵称', length: 50 })
  nickname: string;

  @Column({ comment: '年龄' })
  age: number;

  @Column({ comment: '等级 0-普通会员 1-超值月卡 2-超值季卡 3-超值年卡 4-永久会员', default: 0, type: 'tinyint' })
  level: number;

  @Column({ comment: '积分金币' })
  points: number;

  @Column({
    comment: '余额',
    type: 'decimal',
    precision: 10,
    scale: 2
  })
  balance: number;

  @Column({ comment: '状态 0-禁用 1-启用', default: 1 })
  status: number;

  @Column({ comment: '注册时间', type: 'datetime' })
  registerTime: Date;

  @Column({ comment: '开通时间', type: 'datetime', nullable: true })
  openTime: Date;

  @Column({ comment: '到期时间', type: 'datetime', nullable: true })
  expireTime: Date;

  @Column({ comment: '最近登录', type: 'datetime' })
  lastLogin: Date;
}
